package com.example.chatzsyproject.ui;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.recyclerview.widget.GridLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.example.chatzsyproject.R;
import com.example.chatzsyproject.adapter.CircleOffFriendsAdapter;
import com.example.chatzsyproject.adapter.GroupSetAdapter;
import com.example.chatzsyproject.base.BaseActivity;
import com.example.chatzsyproject.model.CircleOffFriendModel;
import com.example.chatzsyproject.model.FriendModel;
import com.example.chatzsyproject.utils.SpaceItemDecoration;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * 群设置
 */
public class GroupSetActivity extends BaseActivity {
    @BindView(R.id.tv_title)
    TextView tv_title;

    GroupSetAdapter mAdapter;
    @BindView(R.id.recyclerView)
    RecyclerView recyclerView;
    private List<FriendModel> list = new ArrayList<>();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_groupset);
        ButterKnife.bind(this);
        init();
    }

    public void init() {
        tv_title.setText("群聊信息(28)");
        recyclerView.setLayoutManager(new GridLayoutManager(GroupSetActivity.this, 5));
        recyclerView.addItemDecoration(new SpaceItemDecoration(getResources().getDimensionPixelSize(R.dimen.cut_line_height)));
        mAdapter = new GroupSetAdapter(R.layout.adapter_grouppeople, list);
        recyclerView.setAdapter(mAdapter);
        mAdapter.setOnItemClickListener(new BaseQuickAdapter.OnItemClickListener() {
            @Override
            public void onItemClick(BaseQuickAdapter adapter, View view, int position) {

            }
        });

        setData();
    }

    public void setData() {
        for (int i = 0; i < 5; i++) {
            FriendModel friendModel = new FriendModel();
            list.add(friendModel);
        }
        mAdapter.notifyDataSetChanged();
    }
}
